const path = require('path')
const vuxLoader =require('vux-loader')

module.exports = {
    /*
    ** Headers of the page
    */
    head: {
        title: 'cpic_doc',
        meta: [
            {charset: 'utf-8'},
            {name: 'viewport', content: 'width=device-width, initial-scale=1.0, user-scalable=no'},
            {hid: 'description', name: 'description', content: 'Nuxt.js project'}
        ],
        link: [
            {rel: 'icon', type: 'image/x-icon', href: '/favicon.ico'}
        ]
    },
    css:[
        'vux/src/styles/reset.less',
        'vux/src/styles/1px.less'
    ],
    plugins:[
        {
            src:'~/plugins/vux-plugins',
            ssr:false
        },{
            src:'~plugins/vux-components',
            ssr:true
        }
    ],
    /*
    ** Customize the progress bar color
    */
    loading: {color: '#3B8070'},
    /*
    ** Build configuration
    */
    build: {
        /*
        ** Run ESLint on save
        */
        vendor: ['axios'],
        extend(config, { isDev, isClient }) {
            const configs = vuxLoader.merge(config, {
                options: {
                    ssr: true
                },
                plugins: ['vux-ui', {
                    name: 'less-theme',
                    path: path.join(__dirname, './assets/styles/theme.less')
                }]
            })
            return configs
        }
    },
    modules: [
        '@nuxtjs/axios',
        '@nuxtjs/proxy'
    ],
    proxy: [
        ['/outerServer', { target: 'https://cxcimuatssl.cpic.com.cn' }]
    ]
}

